package com.suncnpap.system.service.impl;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.suncnpap.system.mapper.TNoticeNoticeMapper;
import com.suncnpap.system.model.Notice;
import com.suncnpap.system.model.NoticeVo;
import com.suncnpap.system.service.TNoticeNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("tNoticeNoticeService")
public class TNoticeNoticeServiceImpl implements TNoticeNoticeService {

    @Autowired
    private TNoticeNoticeMapper tNoticeNoticeMapper;


    @Override
    public PageInfo<Notice> getNoticestrSchoolIdList(NoticeVo notice, int page, int size) {
        PageHelper.startPage(page,size);
        List<Notice> noticeList = tNoticeNoticeMapper.getNoticeList(notice);
        PageInfo<Notice> hotBooksList = new PageInfo<>(noticeList);
        return hotBooksList;
    }

    @Override
    public Notice details(String id) {
        Notice notice=tNoticeNoticeMapper.detailsById(id);
        return notice;
    }

    @Override
    public Integer hits(String id) {
        Integer notice=tNoticeNoticeMapper.hitsById(id);
        return notice;
    }


//    @Override
//    public PageInfo getNoticestrSchoolIdList(noticeVo notice, int page, int size) {
//        PageHelper.startPage(page,size);
//        List<Notice> noticeList = tNoticeNoticeMapper.getNoticeList(notice);
//        PageInfo<Notice> hotBooksList = new PageInfo<>(noticeList);
//        return hotBooksList;
//    }
}